import { Table, Pagination } from "antd";

interface PropType {
  dataSource: any;
  columns: any;
  page: number;
  total: number;
  pageChange: (page: number) => void;
  sizeChange: (currnet: number, size: number) => void;
}

const Index = (props: PropType) => {
  return (
    <>
      <Table
        dataSource={props.dataSource}
        columns={props.columns}
        rowKey="proid"
        pagination={false}
      />
      <Pagination
        defaultCurrent={props.page}
        total={props.total}
        style={{ display: "flex", justifyContent: "flex-end", marginTop: 20 }}
        onChange={props.pageChange}
        onShowSizeChange={props.sizeChange}
      />
    </>
  );
};

export default Index;
